<?php
namespace Home\Controller;
use Think\Controller;
class UController extends Controller {
    public function index(){
        //判断用户是否登陆
    	$id = I('get.id');
        if ($_SESSION["id"]==null && $id==null) {
            $url = U('home/login/index');
            header( "Location: $url" ); 
            exit();
        }
    	// var_dump($id);
    	$sql = "select * from user where user.id='{$id}'";
    	$users = M()->query($sql);
		$users = current($users);
    	var_dump($users);
    	$this->assign('users',$users);
        $this->assign('title',$users['username'].'的主页');
        $this->display();
    }
   
}